#include "Armor/Armor.h"
#include "General/General.h"

ArmorDetector detector;
Color ENEMYCOLOR = BLUE;

int main()
{
    Mat src;
    VideoCapture cap(0);
    if (!cap.isOpened())
    {
        cout << "camera open failed..." << endl;
        return 0;
    }
    double t1, t2;
    while(1)
    {
        cap >> src;

        t1 = getTickCount();

        detector.setEnemyColor(ENEMYCOLOR);

        detector.run(src);  // 0.8-0.9ms左右

        detector.showDebugInfo(0, 0, 0, 1, 0, 0, 0);

        t2 = getTickCount();

        cout << (t2-t1)/getTickFrequency() << endl;

        //waitKey(10);
    }
    return 0;
}
